package cn.iocoder.yudao.hires.controller.admin.notice.app;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.hires.entity.NoticeReviewDO;
import cn.iocoder.yudao.hires.service.notice.NoticeReviewService;
import cn.iocoder.yudao.hires.vo.noticereview.NoticeReviewPageReqVO;
import cn.iocoder.yudao.hires.vo.noticereview.NoticeReviewSaveReqVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "APP - 下游-面试评价")
@RestController
@RequestMapping("/app/notice-review")
@Validated
public class AppNoticeReviewController {

    @Resource
    private NoticeReviewService noticeReviewService;

    @PostMapping("/create")
    @Operation(summary = "创建面试评价")
    //@PreAuthorize("@ss.hasPermission('system:notice-review:create')")
    public CommonResult<Long> createNoticeReview(@Valid @RequestBody NoticeReviewSaveReqVO createReqVO) {
        return success(noticeReviewService.createNoticeReview(createReqVO));
    }


    @GetMapping("/list")
    @Operation(summary = "面试评价")
    //@PreAuthorize("@ss.hasPermission('system:notice-review:query')")
    public CommonResult<List<NoticeReviewDO>> getNoticeReviewList(Long tenantId) {
        return success(noticeReviewService.getNoticeReviewList(tenantId));
    }

}